/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controladores;

import JPAControllers.LoginJpaController;
import JPAControllers.exceptions.NonexistentEntityException;
import Persistencia.Login;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Alith
 */
public class ControladorLogin {

    Login obj;
    LoginJpaController controlador;

    public void modificarLogin(Login viejo, Login nuevo){
        try {
            controlador = new LoginJpaController();
            controlador.destroy(viejo.getLogin());
            controlador.create(nuevo);
        } catch (NonexistentEntityException ex) {
            Logger.getLogger(ControladorLogin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(ControladorLogin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}
